package cn.cj.erp.common.enums;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * 开关枚举
 * @author chenjian
 */
public enum SwitchEnum implements BaseEnum {
    ON("1", "打开"),
    OFF("0", "关闭");

    @JsonValue
    private final String value;
    private final String label;

    SwitchEnum(String value, String info) {
        this.value = value;
        this.label = info;
    }

    @Override
    public String getValue() {
        return value;
    }

    @Override
    public String getLabel() {
        return label;
    }

    public boolean isOn() {
        return this.equals(ON);
    }

    public boolean isOff() {
        return this.equals(OFF);
    }
}
